# -*- coding: utf-8 -*-
import mysql.connector

config = {
    'host': '',
    'port': 3306,
    'user': '',
    'password': '',
    'database': '',
    'charset': 'utf8'
}
conn = mysql.connector.connect(**config)
cursor = conn.cursor()
sql = "select userid,mobile from destoon_member where userid>=22;"
cursor.execute(sql)
values = cursor.fetchall()

mobile = {}
i = 0
while i < len(values):
	mobile[str(values[i][0])] = values[i][1];
	i = i + 1 
cursor.close()
conn.close()
conn = mysql.connector.connect(**config)
cursor = conn.cursor()
for i in range(22,53):
	if mobile.has_key(str(i)):
		sql1 = "update destoon_company set introduce='不锈钢制品',sell='不锈钢制品', business='不锈钢制品', mail='"+str(i)+"@buxiugang.com', address='未填写', telephone='"+str(mobile[str(i)])+"', fax='null', keyword='不锈钢制品' where userid="+str(i)+";"
		sql2 = "update destoon_company_data set content='不锈钢制品' where userid="+str(i)+";"
		sql3 = "update destoon_member set email='"+str(i)+"@buxiugang.com', msn='null', qq='null' where userid="+str(i)+";"
		cursor.execute(sql1)
		cursor.execute(sql2)
		cursor.execute(sql3)
conn.commit()
cursor.close()
conn.close()

